<?php

/**
 * clients actions.
 *
 * @package    sf_sandbox
 * @subpackage clients
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2288 2006-10-02 15:22:13Z fabien $
 */
class clientsActions extends autoclientsActions
{
	
	public function executeHide()
	{
		$id = (int)$this->getRequestParameter('id');
		$obj = ClientsPeer::retrieveByPK($id);
		$this->forward404Unless($obj);
		
		if( $obj->getStatusId() == MyConstants::AdStatusDeleted )
		{
			$obj->setStatusId(MyConstants::AdStatusAproved);
		}else 
		{
            $obj->setStatusId(MyConstants::AdStatusDeleted);
		}
		
        $obj->save();
		$this->redirect('clients');
	}
	public function executeShowclients()
	{
		$c = new Criteria();
		$c->add(ClientsPeer::STATUS_ID, MyConstants::AdStatusApproved);
        $this->clients = ClientsPeer::doSelect($c);
	}
	
}
